import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AgentGdIncomeVO, AgentGdIncomeForm, AgentGdIncomeQuery } from '@/api/business/agentGdIncome/types';

/**
 * 查询国代收入记录列表
 * @param query
 * @returns {*}
 */

export const listAgentGdIncome = (query?: AgentGdIncomeQuery): AxiosPromise<AgentGdIncomeVO[]> => {
  return request({
    url: '/business/agentGdIncome/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询国代收入记录详细
 * @param id
 */
export const getAgentGdIncome = (id: string | number): AxiosPromise<AgentGdIncomeVO> => {
  return request({
    url: '/business/agentGdIncome/' + id,
    method: 'get'
  });
};

/**
 * 新增国代收入记录
 * @param data
 */
export const addAgentGdIncome = (data: AgentGdIncomeForm) => {
  return request({
    url: '/business/agentGdIncome',
    method: 'post',
    data: data
  });
};

/**
 * 修改国代收入记录
 * @param data
 */
export const updateAgentGdIncome = (data: AgentGdIncomeForm) => {
  return request({
    url: '/business/agentGdIncome',
    method: 'put',
    data: data
  });
};

/**
 * 删除国代收入记录
 * @param id
 */
export const delAgentGdIncome = (id: string | number | Array<string | number>) => {
  return request({
    url: '/business/agentGdIncome/' + id,
    method: 'delete'
  });
};
